package com.kaishengit.service;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import org.springframework.transaction.annotation.Transactional;

import com.kaishengit.dao.PublishDao;
import com.kaishengit.entity.Publish;
import com.kaishengit.util.DateUtil;

@Named
@Transactional
public class PublishService {
	@Inject
	private PublishDao publishDao;

	public List<Publish> findAll() {
		return publishDao.findAll();
	}

	public void save(Publish publish) {
		publish.setCreateTime(DateUtil.getNow());
		publishDao.save(publish);
	}

	public Publish findByProperty(String name, String value) {
		return publishDao.findByProperty(name, value);
	}

	public Publish findById(String id) {
		return publishDao.findById(id);
	}

	public void del(Publish publish) {
		publishDao.del(publish);
	}


	
}
